package com.liuscraft.tradingplatform.utils;

import java.util.Scanner;

/**
 * @author LiusCraft
 * @date 2023/3/24 15:44
 */
public class PromptUtils {
    private static final Scanner scanner = new Scanner(System.in);
    public static boolean yesOrNo(String msg){
        while (true){
            System.out.print(msg);
            switch (scanner.nextLine()){
                case "yes":
                case "y":
                    return true;
                case "no":
                case "n":
                    return false;
            }
        }
    }
}
